int child_allocation_width;
int child_minimum_height, child_natural_height;
- child_allocation_width = MAX (1, child_size);
+ child_allocation_width = child_size;
child_minimum_baseline = -1;
child_natural_baseline = -1;
* and any of the child widgets explicitly request one */
if (baseline == -1 && have_baseline)
{
- gint height = MAX (1, allocation->height);
+ gint height = allocation->height;
/* TODO: This is purely based on the minimum baseline, when things fit we should
use the natural one? */
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
{
child_allocation.y = allocation->y;
- child_allocation.height = MAX (1, allocation->height);
+ child_allocation.height = allocation->height;
if (packing == GTK_PACK_START)
x = allocation->x;
else
else
{
child_allocation.x = allocation->x;
- child_allocation.width = MAX (1, allocation->width);
+ child_allocation.width = allocation->width;
if (packing == GTK_PACK_START)
y = allocation->y;
else
/* Assign the child's position. */
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
{
- child_allocation.width = MAX (1, child_size);
+ child_allocation.width = child_size;
child_allocation.x = x;
if (packing == GTK_PACK_START)
}
else /* (private->orientation == GTK_ORIENTATION_VERTICAL) */
{
- child_allocation.height = MAX (1, child_size);
+ child_allocation.height = child_size;
child_allocation.y = y;
if (packing == GTK_PACK_START)
}
}
- child_size = MAX (1, child_size);
+ child_size = child_size;
child_minimum_baseline = child_natural_baseline = -1;
priv->name = NULL;
priv->allocation.x = -1;
priv->allocation.y = -1;
- priv->allocation.width = 1;
- priv->allocation.height = 1;
+ priv->allocation.width = 0;
+ priv->allocation.height = 0;
priv->clip = priv->allocation;
priv->user_alpha = 255;
priv->alpha = 255;
gtk_widget_queue_resize (priv->parent);
/* Reset the width and height here, to force reallocation if we
- * get added back to a new parent. This won't work if our new
- * allocation is smaller than 1x1 and we actually want a size of 1x1...
- * (would 0x0 be OK here?)
+ * get added back to a new parent.
*/
- priv->allocation.width = 1;
- priv->allocation.height = 1;
+ priv->allocation.width = 0;
+ priv->allocation.height = 0;
if (_gtk_widget_get_realized (widget))
gtk_widget_unrealize (widget);
*
* In this function, the allocation and baseline may be adjusted. The given
* allocation will be forced to be bigger than the widget's minimum size,
- * as well as at least 1×1 in size.
+ * as well as at least 0×0 in size.
*
* Since: 3.10
**/
g_warning ("gtk_widget_size_allocate(): attempt to allocate widget with width %d and height %d",
real_allocation.width,
real_allocation.height);
- }
- real_allocation.width = MAX (real_allocation.width, 1);
- real_allocation.height = MAX (real_allocation.height, 1);
+ real_allocation.width = 0;
+ real_allocation.height = 0;
+ }
baseline_changed = priv->allocated_baseline != baseline;
size_changed = (priv->allocation.width != real_allocation.width ||
{
priv->allocation.x = -1;
priv->allocation.y = -1;
- priv->allocation.width = 1;
- priv->allocation.height = 1;
+ priv->allocation.width = 0;
+ priv->allocation.height = 0;
memset (&priv->clip, 0, sizeof (priv->clip));
memset (&priv->allocated_size, 0, sizeof (priv->allocated_size));
priv->allocated_size_baseline = 0;
g_return_if_fail (width >= -1);
g_return_if_fail (height >= -1);
- if (width == 0)
- width = 1;
- if (height == 0)
- height = 1;
-
gtk_widget_set_usize_internal (widget, width, height);
}